﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Honestysoft.Baseframework.WebUI;

namespace Honestysoft.Financing.WebUI.Module.Reports
{
    public partial class AuditSummary : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }
        }

        private void Bind()
        {
            DateTime startDate = Convert.ToDateTime(Request.QueryString["StartDate"]);
            DateTime endDate = Convert.ToDateTime(Request.QueryString["EndDate"]);
            DataTable dt = new Honestysoft.Financing.BusinessLogic.Reports(Globals.CurrentConnStringName).GetSummaryByDate(startDate,endDate);
            if (dt != null && dt.Rows.Count == 1)
            {
                Count_Project = dt.Rows[0]["Count_Project"].ToString();
                Count_Owner971 = dt.Rows[0]["Count_Owner971"].ToString();
                Count_Owner = dt.Rows[0]["Count_Owner"].ToString();
                Count_Contract = dt.Rows[0]["Count_Contract"].ToString();
                Count_Batch = dt.Rows[0]["Count_Batch"].ToString();
                Count_AT = dt.Rows[0]["Count_AT"].ToString();
                Amount_DocRec = string.Format("{0:N}", dt.Rows[0]["Amount_DocRec"]);
                Amount = string.Format("{0:N}", dt.Rows[0]["Amount"]);
                BFAmount = string.Format("{0:N}", dt.Rows[0]["BFAmount"]);
            }
        }

        protected string Count_Project = "", Count_Owner971="", Count_Owner = "", Count_Contract = "", Count_Batch = "", Count_AT = "", Amount = "", BFAmount = "", Amount_DocRec = "";
    }
}